<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%-- JSTL - Standard Tag Library --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%-- JSTL - Standard Format Library --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%-- Spring Security Tag Library --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html>
<html>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
	-webkit-touch-callout: none;
	/* prevent callout to copy image, etc when tap to hold */
	-webkit-text-size-adjust: none;
	/* prevent webkit from resizing text to fit */
	-webkit-tap-highlight-color: rgba(210, 210, 210, 0.35);
	/* make transparent link selection, adjust last value opacity 0 to 1.0 */
	-webkit-user-select: none;
	/* prevent copy paste, to allow, change 'none' to 'text' */
}

body {
	font-family: "微软雅黑";
	font-size: 12px;
}

ul, li {
	list-style: none;
}

.ylcon {
	width: 100%;
	min-width: 320px;
}

.tit {
	height: 26px;
	line-height: 26px;
	padding: 0px 15px;
	position: relative;
	font-size: 15px;
	color: #aaa;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.story {
	border-bottom: 1px dashed #cecece;
	padding: 0 15px 3px;
	position: relative;
}

.story_t {
	font-size: 1.2em;
	color: rgba(0, 0, 0, 1);
	padding-top: 5px;
	padding-bottom: 2px;
}

.story_m {
	color: rgba(110, 110, 110, 1);
	line-height: 21px;
	word-break: break-all;
	word-wrap: break-word;
	overflow: hidden;
	font-size: 1.2em;
	padding: 2px 0;
}

.story_time {
	color: rgba(154, 154, 154, 1);
	padding: 2px 0;
}

.story_hf {
	background: rgb(245, 245, 245);
	font-size: 1.2em;
	border: 1px solid rgba(204, 204, 204, 0.2);
	border-radius: 2px;
	color: rgba(110, 110, 110, 1);
	padding: 4px;
	margin-bottom: 5px;
}

.opbtn {
	position: absolute;
	top: 0;
	right: 0;
}
</style>
<jsp:include page="/WEB-INF/views/templates/head.jsp" />

<body>

	<jsp:include page="/WEB-INF/views/templates/top.jsp" />

	<%--  Page Content --%>
	<div class="container">
		<div class="row">

			<%--  Blog Entries Column --%>
			<div class="col-md-1"></div>           
			<div class="col-md-10">
				<div class="ylcon">
					<p class="tit">所有留言</p>
					
					<c:if test="${pageContext.request.userPrincipal.name != null}">
					<a href="<c:url value="/app/comment/add/"/><c:out value="${entryId}"/>">发表评论</a>
					</c:if>
					<c:if test="${pageContext.request.userPrincipal.name == null}">
					<a href="<c:url value="/app/login"/>">需要登录后才能评论，点击登录</a>
					</c:if>
					<div id="messDivId">
					<c:choose>		
					<c:when test="${fn:length(comments) > 0}">
						<c:forEach items="${comments}" var="comment">
						<div class="story">
							<div class="opbtn"></div>
							<p class="story_t"><c:out value="${comment.username}"/></p>
							<p class="story_time"><fmt:formatDate type="both" pattern="yyyy/MM/dd HH:mm" value="${comment.creationDate}" /></p>
							<p class="story_m"><c:out value="${comment.content}"/></p>
						</div>
						</c:forEach>
						</c:when>
						</c:choose>
					</div>
				</div>
			</div>
		</div>

		<jsp:include page="/WEB-INF/views/templates/foot.jsp" />

	</div>
	<%--  /.container --%>

</body>